package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户订单详情数据层
 */
@Mapper
public interface OrderDetailMapper {

    /**
     * 插入订单详情表信息
     * @param orderDetailList
     */
    void insertBatch(List<OrderDetail> orderDetailList);

    /**
     * 通过订单ID获取当前的所有订单信息
     * @param id
     * @return
     */
    @Select("select * from order_detail where order_id = #{id}")
    List<OrderDetail> selectOrderDetailByOrderId(Long id);
}
